<template>
  <div>
    <el-card class="vip">
      <!-- 返回操作 -->
      <div slot="header" @click="backClick" class="clearfix vip_header">
        <i></i>
        <h2>返回</h2>
        <h1>MAC软件</h1>
      </div>
      <div class="pluggleable_body">
        <!-- tab栏 -->
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <!-- PS插件 -->
          <el-tab-pane label="PS插件" name="one">
            <!-- 会员表格 -->
            <el-table
              :header-cell-style="{background:'#E9F4FD',color:'#212121'}"
              :data="tableData"
              style="width: 100%"
              @row-click="handleTab"
            >
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="date" label="分类名称"></el-table-column>
              <el-table-column fixed="right" label="操作">
                <template slot-scope="scope">
                  <el-button @click="handleClickvip(scope.row)" type="text">修改</el-button>
                  <el-button type="text" @click="delClick(scope.$index)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <!-- fcpx插件 -->
          <el-tab-pane label="fcpx插件" name="two">
            <!-- 积分表格 -->
            <el-table
              :header-cell-style="{background:'#E9F4FD',color:'#212121'}"
              :data="tableData"
              style="width: 100%"
            >
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="date" label="软件名称"></el-table-column>
              <el-table-column fixed="right" label="操作">
                <template slot-scope="scope">
                  <el-button @click="handleClickIntegral(scope.row)" type="text">修改</el-button>
                  <el-button type="text" @click="delClick(scope.$index)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <!-- AE插件 -->
          <el-tab-pane label="AE插件" name="three">
            <!-- 积分表格 -->
            <el-table
              :header-cell-style="{background:'#E9F4FD',color:'#212121'}"
              :data="tableData"
              style="width: 100%"
            >
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="date" label="软件名称"></el-table-column>
              <el-table-column fixed="right" label="操作">
                <template slot-scope="scope">
                  <el-button @click="handleClickIntegral(scope.row)" type="text">修改</el-button>
                  <el-button type="text" @click="delClick(scope.$index)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <!-- PR预设 -->
          <el-tab-pane label="PR预设" name="four">
            <!-- 积分表格 -->
            <el-table
              :header-cell-style="{background:'#E9F4FD',color:'#212121'}"
              :data="tableData"
              style="width: 100%"
            >
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="date" label="软件名称"></el-table-column>
              <el-table-column fixed="right" label="操作">
                <template slot-scope="scope">
                  <el-button @click="handleClickIntegral(scope.row)" type="text">修改</el-button>
                  <el-button type="text" @click="delClick(scope.$index)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <!-- LR预设 -->
          <el-tab-pane label="LR预设" name="fifth">
            <!-- 积分表格 -->
            <el-table
              :header-cell-style="{background:'#E9F4FD',color:'#212121'}"
              :data="tableData"
              style="width: 100%"
            >
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="date" label="软件名称"></el-table-column>
              <el-table-column fixed="right" label="操作">
                <template slot-scope="scope">
                  <el-button @click="handleClickIntegral(scope.row)" type="text">修改</el-button>
                  <el-button type="text" @click="delClick(scope.$index)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <!-- Sketch插件 -->
          <el-tab-pane label="Sketch插件" name="six">
            <!-- 积分表格 -->
            <el-table
              :header-cell-style="{background:'#E9F4FD',color:'#212121'}"
              :data="tableData"
              style="width: 100%"
            >
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="date" label="软件名称"></el-table-column>
              <el-table-column fixed="right" label="操作">
                <template slot-scope="scope">
                  <el-button @click="handleClickIntegral(scope.row)" type="text">修改</el-button>
                  <el-button type="text" @click="delClick(scope.$index)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <!-- 达芬奇插件 -->
          <el-tab-pane label="达芬奇插件" name="seven">
            <!-- 积分表格 -->
            <el-table
              :header-cell-style="{background:'#E9F4FD',color:'#212121'}"
              :data="tableData"
              style="width: 100%"
            >
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="date" label="软件名称"></el-table-column>
              <el-table-column fixed="right" label="操作">
                <template slot-scope="scope">
                  <el-button @click="handleClickIntegral(scope.row)" type="text">修改</el-button>
                  <el-button type="text" @click="delClick(scope.$index)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <!-- 其他插件 -->
          <el-tab-pane label="其他插件" name="eight">
            <!-- 积分表格 -->
            <el-table
              :header-cell-style="{background:'#E9F4FD',color:'#212121'}"
              :data="tableData"
              style="width: 100%"
            >
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="date" label="软件名称"></el-table-column>
              <el-table-column fixed="right" label="操作">
                <template slot-scope="scope">
                  <el-button @click="handleClickIntegral(scope.row)" type="text">修改</el-button>
                  <el-button type="text" @click="delClick(scope.$index)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs>
        <!-- 按钮 -->
        <div class="btn">
          <el-button @click="newaddGrade">+新增子类</el-button>
          <!-- <el-button @click="newaddIntegral" v-else>+新增积分</el-button> -->
          <el-button>-删除子类</el-button>
        </div>
      </div>
      <!-- 分页 -->
      <el-pagination
        class="fenye app_fenye"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage4"
        :page-sizes="[5, 10, 15, 20]"
        :page-size="2"
        layout="total, sizes, prev, pager, next, jumper"
        :total="4"
      ></el-pagination>
      <!-- 模态框 -->
      <el-dialog
        class="delete vipDialog_btn"
        :visible.sync="Isdelete"
        :showClose="showClo=false"
        width="661px"
      >
        <i @click="Isdelete= false"></i>
        <i></i>
        <h2 class="deldj">
          删除
          {{text}}这一等级
        </h2>
        <p class="pp">你确定删除该等级吗？用户信息请及时安排。</p>
        <span slot="footer" class="dialog-footer">
          <el-button @click="handleSure">确 定</el-button>
          <el-button @click="Isdelete = false">取 消</el-button>
        </span>
      </el-dialog>
    </el-card>
  </div>
</template>


<script>
export default {
  // tab栏切换
  data() {
    return {
      // 分页
      currentPage1: 5,
      currentPage2: 5,
      currentPage3: 5,
      currentPage4: 5,
      text: "普通会员",
      index: 0,
      // tab栏默认选中
      activeName: "one",
      //   表格
      tableData: [],
      Isdelete: false,
      token: this.$route.query.token
    };
  },
  methods: {
    backClick() {
      this.$router.go(-1);
    },
    // 点击切换
    handleClick(tab, event) {
      // console.log(tab, event);
      console.log(this.activeName);
    },
    handleSuccess(response, file, fileList) {
      console.log(response);
      console.log(file);
      console.log(fileList);
      this.uploadImg = fileList.length;
      console.log(this.uploadImg);
    },
    beforeRemove(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    },
    // 点击修改vip
    handleClickvip(scopeRow) {
      console.log(scopeRow);
      this.$router.push("./modify");
    },
    // 点击修改积分
    handleClickIntegral() {
      this.$router.push("./modifyIntegral");
    },
    // 点击删除vip
    delClick(index) {
      console.log(index);
      this.index = index;
      this.Isdelete = true;
    },
    // 模态框确定删除
    handleSure() {
      this.Isdelete = false;
      //   console.log(this.type);
      this.tableData.splice(this.index, 1);
    },
    // 新增等级
    newaddGrade() {
      // console.log(11);
      this.$router.push("./addDegree");
    },
    // 新增积分
    newaddIntegral() {
      // this.$router.push("./addIntegral");
      this.$router.push({
        path: "/addIntegral",
        query: { token: this.token }
      });
    },
    // 分页
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    // 点击单元格触发事件
    handleTab() {
      console.log(11);
      this.$router.push({
        path: "/office_software",
        query: { token: this.token }
      });
    }
  },
  mounted() {}
};
</script>

<style scope>
/* 头部信息 */
.vip_header {
  margin-top: 16px;
  margin-left: 50px;
  position: relative;
  /* border-bottom: 1px solid red; */
}
.vip_header h2 {
  display: inline-block;
  margin: 0;
  margin-left: 12px;
  /* position: absolute; */
  font-size: 20px;
  font-weight: 400;
  color: #3f51b5;
}
.vip_header i {
  /* position: absolute;
  top: 5px;
  left: 0; */
  display: inline-block;
  width: 10px;
  height: 20px;
  background: url("../assets/img/left.png") no-repeat;
  background-size: 10px 20px;
  vertical-align: middle;
}

/* tab */
.vip .el-card__body {
  margin: 8px 80px 34px;
}
.vip .el-tabs__item.is-active {
  background-color: #3040a0;
  color: #fff;
  border-radius: 5px 5px 0 0;
}
.vip .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  padding-left: 20px;
  /* padding: 0 44px; */
}
/* .el-tabs--top .el-tabs__item.is-top:last-child */
.vip .el-tabs--top .el-tabs__item.is-top:last-child {
  padding-right: 20px;
  /* padding: 0 44px; */
}
.vip .el-tabs__nav-wrap::after {
  background-color: #3040a0;
}
.vip .el-tabs__active-bar {
  background-color: #3040a0;
}
.pluggleable_body {
  position: relative;
}
/* 按钮 */
.vip .btn {
  position: absolute;
  top: 0;
  right: 0;
}
.pluggleable_body .btn .el-button {
  border-radius: 5px;
  border: none;
  font-size: 16px;
  color: #ffffff;
}
.pluggleable_body .btn .el-button:nth-child(1) {
  background: #ff3c00;
}
.pluggleable_body .btn .el-button:nth-child(2) {
  background: #bdbdbd;
}
/* 表格 */
.pluggleable_body .el-table th > .cell {
  font-weight: 700;
  font-size: 22px;
}
.pluggleable_body .el-table .cell,
.pluggleable_body .el-button {
  font-size: 18px;

  color: #212121;
}
/* 模态框 */
.delete i:nth-child(1) {
  /* display: block; */
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  background: url("../assets/img/close.png") no-repeat;
  background-size: 38px;
}
.delete i:nth-child(2) {
  display: block;
  width: 40px;
  height: 40px;
  background: url("../assets/img/garbage.png") no-repeat;
  background-size: 40px;
  margin: 0 auto;
}
.deldj {
  font-size: 24px;
  color: #212121;
  text-align: center;
}
.pp {
  font-size: 16px;
  text-align: center;
  color: #757575;
}
.vipDialog_btn .el-dialog__footer {
  text-align: center;
}
.vipDialog_btn .el-button {
  width: 240px;
  height: 47px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  color: #757575;
}
.vipDialog_btn .el-button:nth-child(1) {
  background: url("../assets/img/btn.png") no-repeat;
  border: none;
  color: #fff;
}
.app_fenye {
  text-align: center;
  margin-top: 33px;
}
.vip_header h1 {
    display: inline-block;
    text-align: center;
    margin-left: 40%;

}
</style>